namespace :web_debugger do

  NWD_ROOT = File.dirname(__FILE__) + '/../'

  desc 'Installs required files to get the plugin to work properly.'
  task :install do
    p "Copying the plugin stylesheets..."
    FileUtils.cp Dir[NWD_ROOT + '/assets/stylesheets/*.css'], RAILS_ROOT + '/public/stylesheets'
    p "Copying the plugin images..."
    FileUtils.mkdir RAILS_ROOT + '/public/images/nwd' unless File.exist?(RAILS_ROOT + '/public/images/nwd') 
    FileUtils.cp Dir[NWD_ROOT + '/assets/images/*.*'], RAILS_ROOT + '/public/images/nwd'
    p 'All done!'
  end

  desc 'Removes the installed files.'
  task :remove do
    p "Removing the plugin images..."
    FileUtils.rm_r RAILS_ROOT + '/public/images/nwd' if File.exist?(RAILS_ROOT + '/public/images/nwd') 
    p "Removing the default stylesheet..."
    FileUtils.rm RAILS_ROOT + '/public/stylesheets/ninja_debug.css' if File.exist?(RAILS_ROOT + '/public/stylesheets/ninja_debug.css') 
    p "All done!"
  end

end